import java.util.Random;
import java.util.Scanner;

/**
 * @author 小谷
 */
public class GuessNumber {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            for (int i = 7, j = 0; j < i; j++) {
                Random random = new Random();
                int guess = random.nextInt(100) + 1;
                System.out.println("请输入数字");
                int number = scanner.nextInt();
                if (guess > number) {
                    System.out.println("猜小了");
                } else if (guess < number) {
                    System.out.println("猜大了");
                } else {
                    System.out.println("猜对了");
                    break;
                }
            }
            System.out.println("继续玩输入1，退出游戏输入其他数字");
            int input=scanner.nextInt();
            if (input!=1){
                break;
            }
        }
    }
}
